package br.com.nomeempresa.locadora.controller;

import java.io.IOException;

import br.com.nomeempresa.locadora.app.Principal;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.control.Button;

public class PrincipalController {

    @FXML
    private Button btUsuarios;

    @FXML
    private Button btClientes;

    @FXML
    private Button btFornecedores;

    @FXML
    void eventUsuarios(ActionEvent event) {
    	try{
    		Parent root = FXMLLoader.load(getClass().getResource("/br/com/nomeempresa/locadora/view/Usuario.fxml"));
    		Principal.scene.setRoot(root);
    	}catch(IOException ex){
    		ex.printStackTrace();
    	}
    }

    @FXML
    void eventCllientes(ActionEvent event) {
    	try{
    		Parent root = FXMLLoader.load(getClass().getResource("/br/com/nomeempresa/locadora/view/Cliente.fxml"));
    		Principal.scene.setRoot(root);
    	}catch(IOException ex){
    		ex.printStackTrace();
    	}
    }

    @FXML
    void eventFornecedores(ActionEvent event) {
    	try{
    		Parent root = FXMLLoader.load(getClass().getResource("/br/com/nomeempresa/locadora/view/Fornecedor.fxml"));
    		Principal.scene.setRoot(root);
    	}catch(IOException ex){
    		ex.printStackTrace();
    	}
    }

}
